package xyz.scootaloo.mono.base

import org.junit.Test
import xyz.scootaloo.mono.base.lang.TestDsl
import xyz.scootaloo.mono.base.util.EncryptUtil

/**
 * @author flutterdash@qq.com
 * @since 2021/7/31 21:16
 */
class EncryptUtilTest : TestDsl {

    @Test
    fun simple() {
        val password = "123456"
        val salt = "abcd"
        val encode = EncryptUtil.md5(password, salt).log()

        EncryptUtil.match("bc9b5718afdffe85fb13555347969ff5", "123456", "abcd") shouldBe true
    }

    @Test
    fun genSaltTest() {
        EncryptUtil.generateSalt(8).log()
        EncryptUtil.generateSalt(8).log()
    }

}
